package Classe.proxy;

import java.util.Date;
import java.util.Observer;

import Classe.Agenda;
import Classe.ChambreCategorie;
import Classe.Reservation;

public class ReservationCourante{	
	private Reservation m_Reservation;
	public ReservationCourante(){}
	public void newReservation(Observer o) {	
		m_Reservation = new Reservation(o);
		Agenda.getInstance().addReservation(m_Reservation);
	}

	public void addReservationItem(Date pDebut, Date pFin, int pNbChambre, ChambreCategorie.CategorieChambre pChambreCategorie,Observer o) {
		m_Reservation.addReservationItem(pDebut,pFin,pNbChambre,pChambreCategorie,o);
	}
	public void getReservationData()
	{
		m_Reservation.getData();
	}
	public void confirmer(String pPrenom, String pNom, String pTelephone)
	{
		m_Reservation.confirmer(pPrenom,pNom,pTelephone);
		m_Reservation.deleteObservers();
		m_Reservation = null;
	}
	public void delete()
	{
		Agenda.getInstance().removeReservation(m_Reservation);
		m_Reservation.deleteObservers();
		m_Reservation = null;
	}
	public void addObserver(Observer o , Boolean enfant)
	{
		if (m_Reservation == null)
			throw new IllegalAccessError("Call NewReservation before");
		m_Reservation.addObserver(o);
		if (enfant)
		m_Reservation.addObserverItem(o);
	}

}
